package com.study.controller;

import com.study.service.impl.ExcelSevice;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/excel")
public class ExcelController extends BaseController{
    private ExcelSevice excelSevice = new ExcelSevice();
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String method = req.getParameter("method");

        switch (method){
            case "recordexport":
                recordexport(req, resp);
                break;

        }
    }

    private void recordexport(HttpServletRequest req, HttpServletResponse resp) {
            System.out.println("BlogController.exportExcel");
            excelSevice.exportExcel(resp);
            //toJSON(resp, Result.ok("导出成功"));
    }
}
